package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MemberLevelOperationLogMapper;
import com.ruoyi.system.domain.MemberLevelOperationLog;
import com.ruoyi.system.service.IMemberLevelOperationLogService;

/**
 * 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-14
 */
@Service
public class MemberLevelOperationLogServiceImpl implements IMemberLevelOperationLogService
{
    @Autowired
    private MemberLevelOperationLogMapper memberLevelOperationLogMapper;

    /**
     * 通过id查询会员等级折扣操作记录
     *
     * @param id 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）主键
     * @return 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）
     */
    @Override
    public MemberLevelOperationLog selectMemberLevelOperationLogById(Long id)
    {
        return memberLevelOperationLogMapper.selectMemberLevelOperationLogById(id);
    }

    /**
     * 查询会员等级折扣操作记录列表
     *
     * @param operationType,levelId,operationStartAt,operationEndAt 操作类型，会员等级编号，操作开始时间，操作结束时间
     * @return 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）
     */
    @Override
    public List<MemberLevelOperationLog> selectMemberLevelOperationLogList(String operationType, Long levelId, Date operationStartAt, Date operationEndAt)
    {
        return memberLevelOperationLogMapper.selectMemberLevelOperationLogList(operationType,levelId,operationStartAt,operationEndAt);
    }

    /**
     * 新增会员等级折扣操作记录列表
     *
     * @param memberLevelOperationLog 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）
     * @return 结果
     */
    @Override
    public int insertMemberLevelOperationLog(MemberLevelOperationLog memberLevelOperationLog)
    {
        return memberLevelOperationLogMapper.insertMemberLevelOperationLog(memberLevelOperationLog);
    }

    /**
     * 修改会员等级折扣操作记录列表
     *
     * @param memberLevelOperationLog 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）
     * @return 结果
     */
    @Override
    public int updateMemberLevelOperationLog(MemberLevelOperationLog memberLevelOperationLog)
    {
        return memberLevelOperationLogMapper.updateMemberLevelOperationLog(memberLevelOperationLog);
    }

    /**
     * 批量删除会员等级折扣操作记录列表
     *
     * @param ids 需要删除的会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）主键
     * @return 结果
     */
    @Override
    public int deleteMemberLevelOperationLogByIds(Long[] ids)
    {
        return memberLevelOperationLogMapper.deleteMemberLevelOperationLogByIds(ids);
    }

    /**
     * 删除会员等级折扣操作记录列表
     *
     * @param id 会员等级折扣操作记录（存储会员等级的创建、删除、默认设置及修改等操作记录）主键
     * @return 结果
     */
    @Override
    public int deleteMemberLevelOperationLogById(Long id)
    {
        return memberLevelOperationLogMapper.deleteMemberLevelOperationLogById(id);
    }
}
